···1515# You should have received a copy of the GNU General Public License
1616# along with Retro68. If not, see <http://www.gnu.org/licenses/>.
17171818-find_package(Boost COMPONENTS wave filesystem system thread regex program_options)
1919-2018# Look for bison.
2121- # We need Version 3, and Mac OS X still comes with an outdated version (2.3).
2222- # So we just add the path where the homebrew package manager installs its
2323- # "keg-only" version. Shouldn't hurt on Linux.
2424-set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} "/usr/local/opt/bison/bin")
2525-find_package(BISON 3.0.2)
1919+find_package(BISON)
26202727-if(NOT Boost_FOUND)
2828- message(FATAL_ERROR "The boost libraries have not been found.")
2929-endif()
2121+find_package(Boost REQUIRED COMPONENTS wave filesystem system thread regex program_options)
30223131-if(NOT BISON_FOUND)
3232- message(FATAL_ERROR "GNU Bison version 3.0.2 or later is required.")
3333-endif()
2323+include_directories(
2424+ ${CMAKE_CURRENT_SOURCE_DIR}
2525+ ${CMAKE_CURRENT_SOURCE_DIR}/ResourceFiles
2626+ ${CMAKE_CURRENT_BINARY_DIR}
2727+ ${Boost_INCLUDE_DIR}
2828+)
34293535-include_directories(. ${CMAKE_CURRENT_BINARY_DIR})
3030+add_subdirectory(ResourceFiles)
36313737-set(BISON_OUTPUTS ${CMAKE_CURRENT_BINARY_DIR}/RezParser.generated.cc ${CMAKE_CURRENT_BINARY_DIR}/RezParser.generated.hh
3838- ${CMAKE_CURRENT_BINARY_DIR}/location.hh ${CMAKE_CURRENT_BINARY_DIR}/position.hh
3939- ${CMAKE_CURRENT_BINARY_DIR}/stack.hh)
3232+BISON_TARGET(RezParser RezParser.yy ${CMAKE_CURRENT_BINARY_DIR}/RezParser.generated.cc)
40334141-add_custom_command(OUTPUT ${BISON_OUTPUTS}
4242- COMMAND ${BISON_EXECUTABLE}
4343- ARGS -o ${CMAKE_CURRENT_BINARY_DIR}/RezParser.generated.cc RezParser.yy
4444- DEPENDS RezParser.yy
4545- COMMENT "[BISON][RezParser] Building parser with bison ${BISON_VERSION}"
4646- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
3434+add_executable(Rez
3535+ ${CMAKE_CURRENT_BINARY_DIR}/RezParser.generated.cc
47363737+ RezLexer.cc
3838+ RezLexerNextToken.cc
48394949-add_library(RezLib
5050- RezParser.yy
5151- ${BISON_OUTPUTS}
5252-5353- RezLexer.h
5454- RezLexer.cc
5555- RezLexerWaveToken.h
5656- RezLexerNextToken.cc
5757-5858- RezWorld.cc
5959- RezWorld.h
6060-6161- ResourceDefinitions.cc
6262- ResourceDefinitions.h
6363-6464- Expression.cc
6565- Expression.h
6666-6767- ResourceCompiler.cc
6868- ResourceCompiler.h
4040+ RezWorld.cc
69417070- ResSpec.h
4242+ ResourceDefinitions.cc
71437272- Diagnostic.h Diagnostic.cc
7373- )
7474-target_link_libraries(RezLib ResourceFiles ${Boost_LIBRARIES})
7575-target_include_directories(RezLib PRIVATE ${Boost_INCLUDE_DIR})
4444+ Expression.cc
76457777-add_executable(Rez
7878- Rez.cc
7979- )
8080-target_link_libraries(Rez RezLib ResourceFiles ${Boost_LIBRARIES})
8181-target_include_directories(Rez PRIVATE ${Boost_INCLUDE_DIR})
4646+ ResourceCompiler.cc
4747+ Diagnostic.cc
4848+ Rez.cc
4949+)
82508383-install(TARGETS Rez RUNTIME DESTINATION bin)
5151+target_link_libraries(Rez $<TARGET_OBJECTS:ResourceFiles> ${Boost_LIBRARIES})
84528585-add_subdirectory(Test)
+1-15
src/buildtools/Rez/ResourceFiles/CMakeLists.txt
···1515# You should have received a copy of the GNU General Public License
1616# along with Retro68. If not, see <http://www.gnu.org/licenses/>.
17171818-find_package(Boost COMPONENTS filesystem system REQUIRED)
1919-2020-add_library(ResourceFiles
1818+add_library(ResourceFiles OBJECT
2119 ResourceFork.h ResourceFork.cc
2220 BinaryIO.h BinaryIO.cc
2321 ResType.h ResType.cc
2422 ResourceFile.h ResourceFile.cc
2523 )
26242727-target_link_libraries(ResourceFiles ${Boost_LIBRARIES} ${CMAKE_INSTALL_PREFIX}/lib/libhfs.a)
2828-target_include_directories(ResourceFiles PUBLIC .
2929- PRIVATE ${CMAKE_INSTALL_PREFIX}/include
3030- ${Boost_INCLUDE_DIR})
3131-3232-find_package(Boost COMPONENTS program_options REQUIRED)
3333-3434-add_executable(ResInfo ResInfo.cc)
3535-target_link_libraries(ResInfo ResourceFiles ${Boost_LIBRARIES})
3636-target_include_directories(ResInfo PRIVATE ${Boost_INCLUDE_DIR})
3737-3838-install(TARGETS ResInfo RUNTIME DESTINATION bin)